public class Test6 {
    public static void method(animal a){
a.method();
    }
    public static void main(String[] args) {
animal f =new fox("狐狸");
animal b = new Bird("小鸟");
        method(f);//多肽
        method(b);//多肽
        System.out.println("---------------");
        f.method();//继承
        b.method();//继承
        System.out.println("=============");
        f.name = "小狐狸 ";
                b.name = "小鸟";
        System.out.println(f.name+' '+b.name);
        System.out.println("==================");
        f.method();
        System.out.println("=============");
        System.out.println(f.age);

        if(f instanceof fox){
 f= (fox)f;
            System.out.println(f.age);
        }
    }
}
